Skip to content

Additional cleanup for the register_token functionality#1728

Merged
yrong merged 9 commits intomainfrom
ron/furthur-cleanup-register-token
Mar 3, 2026
Merged

Additional cleanup for the register_token functionality#1728
yrong merged 9 commits intomainfrom
ron/furthur-cleanup-register-token

Conversation

@yrong
Copy link
Contributor

@yrong yrong commented Feb 27, 2026

No description provided.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.40%. Comparing base (e7fa333) to head (3dd43c4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1728      +/-   ##
==========================================
+ Coverage   75.20%   76.40%   +1.20%     
==========================================
  Files          24       24              
  Lines         996      979      -17     
  Branches      186      186              
==========================================
- Hits          749      748       -1     
+ Misses        223      207      -16     
  Partials       24       24              
Flag Coverage Δ
solidity 76.40% <100.00%> (+1.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yrong yrong changed the title Furthur cleanup of register token Additional cleanup for the register_token functionality Feb 27, 2026
@yrong yrong requested a review from Copilot February 27, 2026 09:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request completes the cleanup of deprecated v1 token registration functionality from the Snowbridge codebase. The v1 registerToken functionality has been replaced with a v2 implementation, and this PR removes the remaining v1 code, tests, and documentation.

Changes:

  • Replaced TypeScript v1 registration script with a deprecation notice directing users to v2
  • Removed v1 token registration test file and references from Rust smoketest suite
  • Removed v1 registerToken and quoteRegisterTokenFee functions from Solidity contracts and Go bindings
  • Updated documentation to remove v1 token registration instructions
  • Cleaned up debug print statements in related tests

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web/packages/operations/src/register_erc20.ts Replaced entire v1 registration implementation with deprecation notice
smoketest/tests/v1/set_token_transfer_fees.rs Removed debug print statements for register token fees
smoketest/tests/v1/register_token.rs Deleted entire v1 token registration test file
smoketest/tests/v1.rs Removed module import for deleted register_token test
smoketest/run-v1-tests.sh Removed register_token from test list
smoketest/run-legacy-v1-tests.sh Removed register_token from legacy test list
smoketest/README.md Removed token registration documentation section
relayer/contracts/v1/gateway.go Removed auto-generated Go bindings for registerToken and quoteRegisterTokenFee, updated ABI
relayer/contracts/gateway.go Updated ABI to add InvalidCommand error (unrelated contract change)
relayer/contracts/beefy_client.go Updated ABI to add computeCommitmentHash function (unrelated contract change)
docs/developers/snowbridge-v1/token-transfers.md Removed token registration section from documentation
contracts/test/SubstrateTypes.t.sol Removed RegisterToken test and wrapper function
contracts/src/v1/Calls.sol Removed registerToken, quoteRegisterTokenFee, and helper functions; reformatted quoteSendTokenFee signature
contracts/src/SubstrateTypes.sol Removed RegisterToken encoding function
contracts/.gas-snapshot Removed gas measurements for deleted registerToken tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file still has the implementation for isTokenRegistered. Since token registration functionality has been moved to V2, we should move it there surely?

Copy link
Contributor Author

@yrong yrong Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vgeddes
vgeddes previously approved these changes Feb 27, 2026
@vgeddes vgeddes self-requested a review February 27, 2026 12:07
@vgeddes vgeddes dismissed their stale review February 27, 2026 12:09

need to review more

@vgeddes
Copy link
Collaborator

vgeddes commented Feb 27, 2026

There's also the AssetsStorage.registerTokenFee storage field which is now obsolete. V2 does not seem to use it.

I'd recommend renaming it to something like AssetsStorage.__obsolete_1 and removing all references to it.

@yrong
Copy link
Contributor Author

yrong commented Feb 27, 2026

renaming it to something like AssetsStorage.__obsolete_1 and removing all references to it.

I removed everything in c1f4eac except this part leaving it untouched to ensure compatibility with legacy calls from Polkadot.

@vgeddes
Copy link
Collaborator

vgeddes commented Feb 27, 2026

Still some more things...

vincent@carryx:snowbridge$ rg REGISTER_TOKEN
smoketest/src/constants.rs
76:	pub static ref REGISTER_TOKEN_FEE: u64 = env::var("REGISTER_TOKEN_FEE")

smoketest/tests/v1/set_token_transfer_fees.rs
34:			U256([*REGISTER_TOKEN_FEE, 0, 0, 0]),

web/packages/test/scripts/set-env.sh
97:export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-200000000000000000}"

@vgeddes
Copy link
Collaborator

vgeddes commented Feb 27, 2026

renaming it to something like AssetsStorage.__obsolete_1 and removing all references to it.

I removed everything in c1f4eac except this part leaving it untouched to ensure compatibility with legacy calls from Polkadot.

You should also update the comment for

uint256 registerTokenFee;
saying that this field is now ignored and won't be applied.

@vgeddes
Copy link
Collaborator

vgeddes commented Mar 2, 2026

Looks good now! Please deploy to Westend as a final sanity test.

@yrong yrong merged commit 5a32d7a into main Mar 3, 2026
5 checks passed
@yrong yrong deleted the ron/furthur-cleanup-register-token branch March 3, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants